package com.ea.util;


import java.util.Date;

/**
 * @author Administrator
 * @ClassName: TokenUtil
 * @Description: TODO
 * @date 2021/10/2319:13
 */
public class TokenUtil {
    public final static int CP_TOKEN_EXPIRE = 3600 * 12 * 240;


    public static String createToken(String userId, Byte userType) {
        // 生成一个token
        long expire = CP_TOKEN_EXPIRE;
        String token = JwtUtils.generateToken(userId, userType, expire);
        // 当前时间
        Date now = new Date();
        // 过期时间
        Date expireTime = new Date(now.getTime() + expire * 1000);
        return token;
    }

}
